package com.example.testnt;

public class EchoServerActivity extends AbstractEchoActivity {


    public EchoServerActivity() {
        super(R.layout.activity_abstract_echo);

    }

    public EchoServerActivity(int layoutID) {
        super(R.layout.activity_abstract_echo);

    }

    @Override
    protected void onStartButtonClicked() {

        Integer port = getPort();
        if (port != null) {

            ServerTask serverTask = new ServerTask(startButton,logView, port, this);
            serverTask.start();
        }
    }

    /**
     * 根据给定端口启动tcp服务器
     *
     * @param port
     * @throws Exception
     */
    public native void nativeStartTcpServer(int port) throws Exception;


    /**
     * 根据给定端口启动UDP服务
     *
     * @param port
     * @throws Exception
     */
    public native void nativeStartUdpServer(int port) throws Exception;


    @Override
    public void logMessage(String message) {
        super.logMessage(message);
    }
}
